var path = require("path"),
    webpack = require('webpack'),
    node_modules = path.resolve(__dirname, 'node_modules');

var config = {
	entry: {
        app: path.resolve(__dirname, 'app/main.js'),
        vendors: ['react']
    },
	output: {
        path: path.resolve(__dirname, 'dist'),
        filename: 'bundle.js'
    },
    module: {
    	loaders: [{
    		test: /\.js$/,
            exclude: [node_modules_dir],
    		loader: "babel"
    	}
    },
    plugins: [
        new webpack.optimize.CommonsChunkPlugin('vendors', 'vendors.js')
    ]
};

module.exports = config;